package com.teligen.zkdb.controller;

import com.teligen.zkdb.db.DbConfig;
import com.teligen.zkdb.zk.ZookeeperUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("db")
public class DbController {

    @Autowired
    private ZookeeperUtil zookeeperUtil;

    @GetMapping("/one")
    public void updateDbOne(){
        zookeeperUtil.initDbConfigOne();
    }

    @GetMapping("/two")
    public void updateDbTwo(){
        zookeeperUtil.initDbConfigTwo();
    }
}
